package com.ruoyi.device.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.device.vo.AllDeviceInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.device.mapper.TmdDeviceInformationMapper;
import com.ruoyi.device.domain.TmdDeviceInformation;
import com.ruoyi.device.service.ITmdDeviceInformationService;
import com.ruoyi.common.core.text.Convert;

/**
 * 仪器信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-26
 */
@Service
public class TmdDeviceInformationServiceImpl implements ITmdDeviceInformationService 
{
    @Autowired
    private TmdDeviceInformationMapper tmdDeviceInformationMapper;

    /**
     * 查询仪器信息
     * 
     * @param id 仪器信息主键
     * @return 仪器信息
     */
    @Override
    public TmdDeviceInformation selectTmdDeviceInformationById(Long id)
    {
        return tmdDeviceInformationMapper.selectTmdDeviceInformationById(id);
    }

    /**
     * 查询仪器信息列表
     * 
     * @param tmdDeviceInformation 仪器信息
     * @return 仪器信息
     */
    @Override
    public List<TmdDeviceInformation> selectTmdDeviceInformationList(TmdDeviceInformation tmdDeviceInformation)
    {
        return tmdDeviceInformationMapper.selectTmdDeviceInformationList(tmdDeviceInformation);
    }

    /**
     * 新增仪器信息
     * 
     * @param tmdDeviceInformation 仪器信息
     * @return 结果
     */
    @Override
    public int insertTmdDeviceInformation(TmdDeviceInformation tmdDeviceInformation)
    {
        tmdDeviceInformation.setCreateTime(DateUtils.getNowDate());
        return tmdDeviceInformationMapper.insertTmdDeviceInformation(tmdDeviceInformation);
    }

    /**
     * 修改仪器信息
     * 
     * @param tmdDeviceInformation 仪器信息
     * @return 结果
     */
    @Override
    public int updateTmdDeviceInformation(TmdDeviceInformation tmdDeviceInformation)
    {
        return tmdDeviceInformationMapper.updateTmdDeviceInformation(tmdDeviceInformation);
    }

    /**
     * 批量删除仪器信息
     * 
     * @param ids 需要删除的仪器信息主键
     * @return 结果
     */
    @Override
    public int deleteTmdDeviceInformationByIds(String ids)
    {
        return tmdDeviceInformationMapper.deleteTmdDeviceInformationByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除仪器信息信息
     * 
     * @param id 仪器信息主键
     * @return 结果
     */
    @Override
    public int deleteTmdDeviceInformationById(Long id)
    {
        return tmdDeviceInformationMapper.deleteTmdDeviceInformationById(id);
    }

    @Override
    public void updateStatus(Long id) {
        tmdDeviceInformationMapper.updateStatus(id);
    }

    @Override
    public void InupdateStatus(Long id) {
        tmdDeviceInformationMapper.InupdateStatus(id);
    }

    @Override
    public List<TmdDeviceInformation> selectTmdDeviceInformationListByUserName(String userName) {
        return tmdDeviceInformationMapper.selectTmdDeviceInformationListByUserName(userName);
    }

    @Override
    public AllDeviceInfoVo selectMyUseById(Long id) {
        return tmdDeviceInformationMapper.selectMyUseById(id);
    }

    @Override
    public List<AllDeviceInfoVo> selectTmdDeviceInformationListByUserId(Long userId) {
        return tmdDeviceInformationMapper.selectTmdDeviceInformationListByUserId(userId);
    }

    @Override
    public List<AllDeviceInfoVo> selectAllTmdDeviceInformationList() {
        return tmdDeviceInformationMapper. selectAllTmdDeviceInformationList();
    }


}

